/* 
 * File:   driver_led.h
 * Author: Ich
 *
 * Created on 12. Januar 2014, 16:53
 *
 * Description:
 * controls the led strip mit led-module WS2812B
 */

#ifndef DRIVER_LED_H
#define	DRIVER_LED_H

#ifdef	__cplusplus
extern "C" {
#endif
#include <GenericTypeDefs.h>
/*******************************************************************************
 *  public preprocessing definitions
 */

#define DRVLED_FREQ             (800000)    // Frequency to drive LEDs
#define DRVLED_MAX_LED          (120)       // drive can ontrol this number of LED's
 /*******************************************************************************
 *  public variables
 */
    typedef struct
    {
        UINT8 green;
        UINT8 red;
        UINT8 blue;
    }color_t;
/*******************************************************************************
 *  public functions
 */

/* Initialises LED module.
 *
 * param(in)    nofLeds         [0..200] number of LED's to drive.
 *
 * return   true=success, else error
 */
BOOL drvLed_init                (UINT16 nofLeds);


/* sets the color on all LEDs.
 *
 * return   true=success, else error
 */
BOOL drvLed_setAll              (color_t color);


/* sets the color on the specific LED.
 *
 * return   true=success, else error
 */
BOOL drvLed_set                 (UINT16 ledNbr, color_t color);


/* gets the color on the specific LED.
 *
 * param(in)    ledNbr          number of the LED
 * param(out)   outColor        pointer to the color of this LED
 *
 * return   true=success, else error
 */
BOOL drvLed_get                 (UINT16 ledNbr, color_t *outColor);


/* refresh all LEDs with the specific color
 *
 * return   true=success, else error
 */
BOOL drvLed_refresh             (void);




#ifdef	__cplusplus
}
#endif

#endif	/* DRIVER_LED_H */

